#version 430 
layout(location= 100)uniform vec4 uColor;

out vec4 outColor;

vec3 lightDir =  vec3(-1, -1, 0);

in vec3 vnormal;

void main()
{
	vec3 normal = normalize(vnormal);
	float diffuse =  dot(normal, -lightDir);
	diffuse = abs(diffuse);
	float f = 1.0;
	if (diffuse < 0.3 )
	{
		f = 0.4;
	}
	else if (diffuse < 0.65 )
	{
		f = 0.6;
	} 
	else if (diffuse < 0.93 )
	{
		f = 0.8;
	} 

	vec3 color = uColor.rgb*( 0.6 +  0.4 * f);

	outColor = vec4(color * f, uColor.a);
}